#include"manager.h"
#include<cstdlib>

Manager::Manager()
{
    offset = 0;
    elemsize = 32;
    numelements = 20000000;
    pool = malloc(numelements*elemsize);
}

Manager::~Manager()
{
    free(pool);
}

void* Manager::allocate()
{
    if(offset==numelements)
    {
        throw 1;
    }
    ++offset;
    return (void*)((char*)pool+(offset-1)*elemsize);
}